<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>员工管理</title>
    <%@ include file="common.jsp"%>
    <script type="text/javascript" src="/static/js/employee.js"></script>
</head>
<body>
    <table id="emp_datagrid"></table>

    <div id="emp_toolbar">
        <a class="easyui-linkbutton" iconCls="icon-add" data-method="add" plain="true">新增</a>
        <a class="easyui-linkbutton" iconCls="icon-edit"  data-method="edit" plain="true">编辑</a>
        <a id="btn_state" class="easyui-linkbutton" iconCls="icon-remove"  data-method="changeState" plain="true">离职</a>
        <a id="btn_changePassword" class="easyui-linkbutton" iconCls="icon-man"  data-method="changePassword" plain="true">重置密码</a>
        <a class="easyui-linkbutton" iconCls="icon-clear"  data-method="importData" plain="true">导入</a>
        <a class="easyui-linkbutton" iconCls="icon-dog"  data-method="export" plain="true">导出</a>
        <%--高级查询,要有name因为导入的时候要提交参数--%>
        <form id="emp_queyForm" method="post">
            <input id="keyword" class="easyui-textbox" name="keyword" style="width:150px" data-options="prompt:'请输入用户或邮箱'">
            入职时间:<input id="beginDate" class="easyui-datebox" name="beginDate" editable='false' style="width:120px">
            ~<input id="endDate" class="easyui-datebox" name="endDate"  editable='false' style="width:120px">
            部门:<input id="deptId" class="easyui-combobox" name="deptId" panelHeight="auto"
                      data-options="url:'/department/list.do',valueField:'id',textField:'name',limitToList:'true'" style="width:100px">
            <a class="easyui-linkbutton" iconCls="icon-search"  data-method="query" plain="true">搜索</a>
        </form>
    </div>


    <div id="emp_dialog" style="margin-top: 15px">
        <form method="post" id="emp_form">
            <input type="hidden" name="id" id="empId">
            <table align="center">
                <tr>
                    <td>用户名</td>
                    <td><input class="easyui-textbox" name="username"
                               validType="remote['/employee/validateByName.do?id='+empId.value,'username']"
                               invalidMessage="用户名已存在"/></td>
                </tr>
                <tr>
                    <td>真实姓名</td>
                    <td><input class="easyui-textbox" name="realname"/></td>
                </tr>
                <tr id="tr_password">
                    <td>密码</td>
                    <td><input class="easyui-passwordbox" name="password" data-options="required:true"/></td>
                </tr>
                <tr>
                    <td>电话</td>
                    <td><input class="easyui-numberbox" name="tel" /></td>
                </tr>
                <tr>
                    <td>邮箱</td>
                    <td><input class="easyui-textbox" name="email" /></td>
                </tr>
                <tr>
                    <td>入职时间:</td>
                    <td><input name="hireDate" class="easyui-datebox" editable='false'></td>
                </tr>
                <tr>
                    <td>部门</td>
                    <td><input class="easyui-combobox" name="dept.id" panelHeight="auto"
                           data-options="valueField:'id',textField:'name',url:'/department/list.do',limitToList:'true'"/></td>
                </tr>
                <tr>
                    <td>管理员</td>
                    <td><input class="easyui-combobox" name="admin" data-options="valueField:'value',textField:'text',limitToList:'true',
                            data:[{text:'是',value:'1'},{text:'否',value:'0'}]" panelHeight="auto"/></td>
                </tr>
                <tr>
                    <td>角色分配</td>
                    <td><input id="role_combobox" class="easyui-combobox" name="role.id" panelHeight="auto" multiple="true"
                               data-options="valueField:'id',textField:'name',limitToList:'true',url:'/role/query.do'"/></td>
                </tr>

            </table>
        </form>
    </div>
    <%--修改密码框--%>
    <div id="emp_pwddialog" style="margin-top: 15px" align="center">
        <form method="post" id="password_form">
            <input type="hidden" name="id">
            新的密码:<input class="easyui-passwordbox" name="newPassword">
        </form>
    </div>

    <%--导入数据弹出框--%>
    <div id="emp_importData" style="margin-top: 15px" align="center">
        <form method="post" action="/employee/importData.do" id="importData_form" enctype="multipart/form-data">
            <input type="file" name="file" ><br/>
            <span class="importDataMsg"></span>
        </form>
    </div>
</body>
</html>
